package com.test.demon2;

public class Dog extends Animal{
    public String color;

    public void bark(){
        System.out.println(this.name+" 汪汪叫...");
    }

    static {
        System.out.println("子类的静态代码块执行了");
    }

    {
        System.out.println("子类的实例代码块执行了");

    }

    public Dog() {
        //子类在构造完成前，先要完成父类的构造
        super();
        System.out.println("子类的构造方法执行了");
    }

    public static void main(String[] args) {
        Dog dog = new Dog();
    }

/*    public static void main(String[] args) {
        Dog dog = new Dog("小七",5,"White");
    }

    public Dog(String name,int age,String color) {
        super("小黑",4);
        this.color = "Black";
        System.out.println(this.name+" "+this.age+" "+this.color);
    }*/

}
